//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Query Application Block
//===============================================================================

using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using EntLibContrib.Query.Configuration;

namespace EntLibContrib.Query.Parameters
{
	/// <summary>
	/// Parameter to hold the name, namespace and value elements of a single xml query parameter
	/// </summary>
	[ConfigurationElementType(typeof(XmlParameterData))]
	public class XmlParameter : Parameter
	{
		#region Fields
		private string namespaceName;
		#endregion

		#region Properties
		/// <summary>
		/// Gets or sets the namespace of the parameter.
		/// </summary>
		/// <value>The namespace of the parameter.</value>
		public string Namespace
		{
			get { return namespaceName; }
			set { namespaceName = value; }
		}
		#endregion

		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="XmlParameter"/> class.
		/// </summary>
		/// <param name="name">The parameter name.</param>
		public XmlParameter(string name)
			: this(name, string.Empty)
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="XmlParameter"/> class.
		/// </summary>
		/// <param name="name">The parameter name.</param>
		/// <param name="namespaceName">Name of the namespace.</param>
		public XmlParameter(string name, string namespaceName)
			: base(name)
		{
			this.namespaceName = namespaceName;
		}
		#endregion
	}
}
